var QQMapWX = require('qqmap-wx-jssdk.min.js');
var comm=require('comm_util.js')
var qqmapsdk = new QQMapWX({
    key: '3JFBZ-EED3Q-JJ25R-G364V-O2EHV-DSBO6'
});
/**
 * 方地理位置编码 输出经纬度 返回地理位置数据
 */
function getReverseGeocoder(_latitude,_longitude,callback){
    qqmapsdk.reverseGeocoder({
        location: {
            latitude: _latitude,
            longitude: _longitude
        },
        success: function (addressRes) {
            console.log(addressRes)
            if (comm.isFunctinMethod(callback)){
                // var address = addressRes.result.address_component.city;
                // console.log("city=", address)
                callback(addressRes)
            } 
        }
    })
}
module.exports = {
    getReverseGeocoder: getReverseGeocoder,
}
